from kafka import KafkaConsumer

consumer = KafkaConsumer('testPython',
                         group_id='my-group',
                         bootstrap_servers=['master:9092'],
                         )
for message in consumer:
    print ("%s:%d:%d: key=%s value=%s" %
           (message.topic, message.partition,
            message.offset, message.key,
            message.value))